//
//  RateMode.m
//  ImGuider
//
//  Created by 李陆涛 on 2018/2/27.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "RateMode.h"

@implementation RateMode


- (NSString *)realMoney {
    
    if (self.baseMoney && self.baseMoney.length > 0) {
        return @(self.baseMoney.floatValue * self.rate.floatValue).stringValue;
    }
    
    return nil;
}

- (NSString *)smartName {
    
    NSString *name = @"";
    
    switch (AppManager.sharedManager.language) {
        case AppLanguageCNJan:
            
            name = _cname;
            break;
        case AppLanguageCNFan:
        case AppLanguageCNFanXG:
            
            name = _fname;
            break;
        case AppLanguageJapanese:
            
            name = _jname;
            break;
        default:
            
            name = _ename;
            break;
    }
    
    if (name.length == 0) {
        name = _ename ? _ename : _country;
    }
    return name;
}

@end
